package com.example.its2021606134chh.TrafficViolationModule;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.example.its2021606134chh.R;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link TVVideoFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class TVVideoFragment extends Fragment {

    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "title";
    private static final String ARG_PARAM2 = "param2";

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;
    private ImageView imgTVVideo1;
    private TextView tvTVVideo1;
    private ImageView imgTVVideo2;
    private TextView tvTVVideo2;
    private ImageView imgTVVideo3;
    private TextView tvTVVideo3;
    private ImageView imgTVVideo4;
    private TextView tvTVVideo4;
    private ImageView imgTVVideo5;
    private TextView tvTVVideo5;

    public TVVideoFragment() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @param param1 Parameter 1.
     * @param param2 Parameter 2.
     * @return A new instance of fragment TVVideoFragment.
     */
    // TODO: Rename and change types and number of parameters
    public static TVVideoFragment newInstance(String param1, String param2) {
        TVVideoFragment fragment = new TVVideoFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_t_v_video, container, false);
        imgTVVideo1 = (ImageView) view.findViewById(R.id.imgTVVideo1);
        tvTVVideo1 = (TextView) view.findViewById(R.id.tvTVVideo1);
        imgTVVideo2 = (ImageView) view.findViewById(R.id.imgTVVideo2);
        tvTVVideo2 = (TextView) view.findViewById(R.id.tvTVVideo2);
        imgTVVideo3 = (ImageView) view.findViewById(R.id.imgTVVideo3);
        tvTVVideo3 = (TextView) view.findViewById(R.id.tvTVVideo3);
        imgTVVideo4 = (ImageView) view.findViewById(R.id.imgTVVideo4);
        tvTVVideo4 = (TextView) view.findViewById(R.id.tvTVVideo4);
        imgTVVideo5 = (ImageView) view.findViewById(R.id.imgTVVideo5);
        tvTVVideo5 = (TextView) view.findViewById(R.id.tvTVVideo5);
        // Inflate the layout for this fragment
        imgTVVideo1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), TVVideoActivity.class);
                startActivity(intent);
            }
        });
        imgTVVideo2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), TVVideoActivity.class);
                startActivity(intent);
            }
        });
        imgTVVideo3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), TVVideoActivity.class);
                startActivity(intent);
            }
        });
        imgTVVideo4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), TVVideoActivity.class);
                startActivity(intent);
            }
        });
        imgTVVideo5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), TVVideoActivity.class);
                startActivity(intent);
            }
        });
        return view;
    }

}